import request from '@/utils/request'

export const findAll = () =>
  request({
    url: `/dispatch/running-state/findAll`,
    method: 'get'
  })

export const findByPage = (page) =>
  request({
    url: `/dispatch/running-state/findByPage?page=${page}`,
    method: 'get'
  })

// 创建参数
export function createRunningState(data) {
  return request({
    url: '/dispatch/running-state/create',
    method: 'post',
    data: data
  })
}

// 更新参数
export function updateRunningState(data) {
  return request({
    url: '/dispatch/running-state/update',
    method: 'put',
    data: data
  })
}

// 删除参数
export function deleteRunningState(id) {
  return request({
    url: '/dispatch/running-state/delete?id=' + id,
    method: 'delete'
  })
}

// 获得参数
export function getRunningState(id) {
  return request({
    url: '/dispatch/running-state/get?id=' + id,
    method: 'get'
  })
}

// 获得参数分页
export function getRunningStatePage(query) {
  return request({
    url: '/dispatch/running-state/page',
    method: 'get',
    params: query
  })
}

// 导出参数 Excel
export function exportRunningStateExcel(query) {
  return request({
    url: '/dispatch/running-state/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
